<?php
/**
 * @project     : Travel
 * @copyright   : 
 * @desc        : Thuc hien cac thao tac tren bang contact
 * @coder       : Truong cong quyen
 * @createdate  : 3/11/2011
*/
class Contact_model extends CI_Model
{
    
    var $contact_id = -1;
	var $contact_fullname = '';
	var $contact_address = '';
	var $contact_email = '';
	var $contact_phone = '';
	var $contact_title = '';
	var $contact_content = '';
	var $contact_status = 1;
    
    /**
     * 
     * Constructor
     * 
     */
    public function __construct() 
    {
        parent::__construct();
    }
    
    function get_all($status=1)
    {
        if($status!=-1)
        {
            $this->db->where('contact_status', $status);
        }
        $query = $this->db->get('contact');
        return $query->result();
        
    }
    
     function get_by_id($id)
    {
        $this->db->where('contact_id', $id);
        $query = $this->db->get('contact');
        return $query->row();
    }
}